import Vue from 'vue'
import App from './App'
// vuex
import store from './store'
// 引入全局api配置地址
import apis from './common/js/apis'
// 引入全局uView
import uView from '@/uni_modules/uview-ui'
import mixins from './common/js/mixins'
import enumConfigs from './common/js/enumConfigs.js'
import mxConfigs from './common/js/mxConfigs.js'
import tui from './common/tui/httpRequest'
import configs from './common/js/configs.js'
import * as tools from './common/js/tools.js'
// vueJsonp
import { VueJsonp } from "vue-jsonp"
import JsonExcel from "vue-json-excel"

// #ifdef H5
window.QQmap = null;
// #endif
// #ifndef MP-TOUTIAO
//网络监听
setTimeout(() => {
	uni.onNetworkStatusChange(function(res) {
		//console.log(res.networkType);
		store.commit("networkChange", {
			isConnected: res.isConnected
		})
	});
}, 100)
// #endif

// Vue.component('downloadExcel', JsonExcel)

Vue.config.productionTip = false
Vue.prototype.$apis = apis
Vue.prototype.tui = tui
Vue.prototype.$store = store
Vue.prototype.$configs = configs
Vue.prototype.$tools = tools

App.mpType = 'app'

Vue.use(uView)
Vue.use(VueJsonp)

// #ifdef MP
// 引入uView对小程序分享的mixin封装
const mpShare = require('@/uni_modules/uview-ui/libs/mixin/mpShare.js')
Vue.mixin(mpShare)
// #endif

Vue.mixin(mixins)
Vue.mixin(enumConfigs)
Vue.mixin(mxConfigs)

const app = new Vue({
	store,
	...App
})

// 引入请求封装
require('./utils/request/index')(app)

app.$mount()

// 页面异步执行
Vue.prototype.$onLaunched = new Promise(resolve => {
    Vue.prototype.$isResolve = resolve
})